package com.qidian.mes.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qidian.mes.mapper.FeedbackMapper;
import com.qidian.mes.pojo.Feedback;
import com.qidian.mes.service.FeedbackService;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class FeedbackServiceImpl implements FeedbackService {
    @Autowired
    private FeedbackMapper feedbackMapper;
    @Override
    public MESResult list(int page, int limit, Feedback feedback) {
        PageHelper.startPage(page,limit);
        List<Feedback> list= feedbackMapper.list(feedback);
        PageInfo<Feedback> pageInfo = new PageInfo<>(list);
        return MESResult.ok(pageInfo);
    }

    @Override
    public MESResult delete(Long recordId) {
        feedbackMapper.deleteById(recordId);
        return MESResult.ok();
    }
}
